// Copyright (C) <2018> Zealcomm Inc.
//
// SPDX-License-Identifier: Apache-2.0
#import <AVFoundation/AVFoundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
#import <WebRTC/RTCMacros.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, IRTCAudioCodec) {
  IRTCAudioCodecPcmu = 1,
  IRTCAudioCodecPcma = 2,
  IRTCAudioCodecOpus = 3,
  IRTCAudioCodecG722 = 4,
  IRTCAudioCodecIsac = 5,
  IRTCAudioCodecIlbc = 6,
  IRTCAudioCodecAac = 7,
  IRTCAudioCodecAc3 = 8,
  IRTCAudioCodecAsao = 9,
  IRTCAudioCodecUnknown = 10,
};
typedef NS_ENUM(NSInteger, IRTCVideoCodec) {
  IRTCVideoCodecVP8 = 1,
  IRTCVideoCodecVP9 = 2,
  IRTCVideoCodecH264 = 3,
  IRTCVideoCodecH265 = 4,
  IRTCVideoCodecUnknown = 5,
};
typedef NS_ENUM(NSInteger, IRTCAudioSourceInfo) {
  IRTCAudioSourceInfoMic = 1,
  IRTCAudioSourceInfoScreenCast = 2,
  IRTCAudioSourceInfoFile = 3,
  IRTCAudioSourceInfoMixed = 4,
  IRTCAudioSourceInfoUnknown = 5,
};
typedef NS_ENUM(NSInteger, IRTCVideoSourceInfo) {
  IRTCVideoSourceInfoCamera = 1,
  IRTCVideoSourceInfoScreenCast = 2,
  IRTCVideoSourceInfoFile = 3,
  IRTCVideoSourceInfoMixed = 4,
  IRTCVideoSourceInfoUnknown = 5,
};
typedef NS_OPTIONS(NSInteger, IRTCTrackKind) {
  IRTCTrackKindUnknown = 0,
  IRTCTrackKindAudio = 1 << 0,
  IRTCTrackKindVideo = 1 << 1,
};
/// Codec parameters for an audio track.<br>音频轨的编码参数。
RTC_EXPORT
@interface IRTCAudioCodecParameters : NSObject
/**
 @brief Name of a codec.<br>音频编码的名字。
 @details some functions do not support all the values in IRTCAudioCodec.<br>有些函数并不支持IRTCAudioCodec里的所有值。
*/
@property(nonatomic, assign) IRTCAudioCodec name;
/// Numbers of channels for an audio track.<br>音频轨的声道数量。
@property(nonatomic, assign) NSUInteger channelCount;
/// The codec clock rate expressed in Hertz.<br>编码时钟频率（Hertz）。
@property(nonatomic, assign) NSUInteger clockRate;
@end
/// Codec parameters for a video track.<br>视频轨的编码参数
RTC_EXPORT
@interface IRTCVideoCodecParameters : NSObject
/**
 @brief Name of a codec.<br>视频编码的名字。
 @details some functions do not support all the values in IRTCVideoCodec.<br>有些函数并不支持IRTCVideoCodec里的所有值。
*/
@property(nonatomic, assign) IRTCVideoCodec name;
/**
 @brief The profile of a codec.<br>视频编码的标准。
 @details Profile may not apply to all codecs.<br>编码标准并不适用于所有编码。
*/
@property(nonatomic, strong) NSString* profile;
@end
/// The audio settings of a publication.<br>一个发布的音频设置。
RTC_EXPORT
@interface IRTCAudioPublicationSettings : NSObject
@property(nonatomic, strong) IRTCAudioCodecParameters* codec;
@end
/// The video settings of a publication.<br>一个发布的视频设置。
RTC_EXPORT
@interface IRTCVideoPublicationSettings : NSObject
@property(nonatomic, strong) IRTCVideoCodecParameters* codec;
@property(nonatomic, assign) CGSize resolution;
@property(nonatomic, assign) CGFloat frameRate;
@property(nonatomic, assign) NSUInteger bitrate;
@property(nonatomic, assign) NSUInteger keyframeInterval;
@end
/// The settings of a publication.<br>一个发布的设置参数。
RTC_EXPORT
@interface IRTCPublicationSettings : NSObject
@property(nonatomic, strong) IRTCAudioPublicationSettings* audio;
@property(nonatomic, strong) IRTCVideoPublicationSettings* video;
@end
/// Represents the audio capability for subscription.<br>代表订阅的音频能力。
RTC_EXPORT
@interface IRTCAudioSubscriptionCapabilities : NSObject
@property(nonatomic, strong) NSArray<IRTCAudioCodecParameters*>* codecs;
@end
/// Represents the video capability for subscription.<br>代表订阅的视频能力。
RTC_EXPORT
@interface IRTCVideoSubscriptionCapabilities : NSObject
@property(nonatomic, strong) NSArray<IRTCVideoCodecParameters*>* codecs;
@property(nonatomic, strong) NSArray<NSValue*>* resolutions;
@property(nonatomic, strong) NSArray<NSNumber*>* frameRates;
@property(nonatomic, strong) NSArray<NSNumber*>* bitrateMultipliers;
@property(nonatomic, strong) NSArray<NSNumber*>* keyframeIntervals;
@end
/// Represents the capability for subscription.<br>代表订阅的能力。
RTC_EXPORT
@interface IRTCSubscriptionCapabilities : NSObject
@property(nonatomic, strong) IRTCAudioSubscriptionCapabilities* audio;
@property(nonatomic, strong) IRTCVideoSubscriptionCapabilities* video;
@end
/// Information of a stream's source.<br>媒体源的信息。
RTC_EXPORT
@interface IRTCStreamSourceInfo : NSObject
@property(nonatomic, assign) IRTCAudioSourceInfo audio;
@property(nonatomic, assign) IRTCVideoSourceInfo video;
@end
RTC_EXPORT
/// Constraints for creating a video MediaStreamTrack.<br>创建视频媒体流轨的配置参数。
@interface IRTCVideoTrackConstraints : NSObject
@property(nonatomic, assign) double frameRate;
@property(nonatomic, assign) CGSize resolution;
@property(nonatomic, assign) AVCaptureDevicePosition devicePosition;
@end
/// Constraints for creating a MediaStream from screen mic and camera.<br>从屏幕麦克风和摄像头创建媒体流的配置参数。
RTC_EXPORT
@interface IRTCStreamConstraints : NSObject
/**
  @brief Indicate whether audio track is enabled.<br>这个参数说明是否启用音频轨。
  @details If audio is true, MediaStream created with this constraints object
  will capture audio from mic. Otherwise, audio will be disabled.<br>如果启用音频轨，用这个参数创建的MediaStream会使用麦克风采集音频。否则，音频轨不会被使用。
 */
@property(nonatomic, assign) BOOL audio;
/// Constraints for video track.<br>视频轨的配置参数。
@property(nonatomic, strong, nullable) IRTCVideoTrackConstraints* video;
@end
RTC_EXPORT
/// Encoding parameters for sending an audio track.<br>发送音频轨时的编码参数。
@interface IRTCAudioEncodingParameters : NSObject
@property(nonatomic, strong) IRTCAudioCodecParameters* codec;
/// Max bitrate expressed in bps.<br>音频媒体流的最大码率(bps)。
@property(nonatomic, assign) NSUInteger maxBitrate;
@end
RTC_EXPORT
/// Encoding parameters for sending a video track.<br>发送视频轨时的编码参数。
@interface IRTCVideoEncodingParameters : NSObject
@property(nonatomic, strong) IRTCVideoCodecParameters* codec;
/// Max bitrate expressed in bps.<br>视频媒体流的最大码率(bps)。
@property(nonatomic, assign) NSUInteger maxBitrate;
@end
NS_ASSUME_NONNULL_END
